'use strict';
var React=require( 'react');
var reactDom=require( 'react-dom/server');
var reactRedux=require('react-redux');
var configureStore=require('../public/javascripts/stores/index.js');
var HkfsMyAccount=require( '../public/javascripts/containers/pc/HkfsMyAccount.jsx');
var Provider=reactRedux.Provider;
const store = configureStore();
var ModelRender=require('./modelRender.jsx');
var actions=require('../public/javascripts/actions/myAccount');

exports.RenderFunc=(userId,renderCallBack)=>{
    if(renderCallBack) {
        store.dispatch(actions.receiveMyPhone(userId));
        var modelRender=new ModelRender();
        var main = reactDom.renderToString(
            <Provider store={store}>
                <HkfsMyAccount/>
            </Provider>
        );
        var initializeStore = JSON.stringify(store.getState());
        renderCallBack(modelRender.headerRender(),modelRender.barRender(),modelRender.footerRender(),main, initializeStore);
    }
};